<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- 引入 Bootstrap -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<title>添加部门</title>
<style>
/*header的样式*/
.header{
	height:50dp;
	background:#ddd;
	
}
</style>
</head>

<body>
<div class="header">
<h1>某高校后勤管理</h1>
</div>
<div class="container">
<form class="form-horizontal" style="width:700px">
        <div class="form-group">
          <label class="control-label col-sm-2" for="name">部门名称：</label>
          <div class="col-sm-10">
            <input type="text" class="form-control" id="dept_name" value="人事部" />
          </div>
        </div>
        <div class="form-group">
          <label class="control-label col-sm-2" for="province">负责人名称：</label>
          <div class="col-sm-10">
            <input type="text" class="form-control" id="dept_principal" value="xxx" />
          </div>
        </div>
        <div class="form-group">
          <label class="control-label col-sm-2" for="city">部门编号：</label>
          <div class="col-sm-10">
            <input type="text" class="form-control" id="dept_number" value="1001" />
          </div>
        </div>
        <div class="form-group">
          <label class="control-label col-sm-2" for="city">部门职责说明：</label>
          <div class="col-sm-10">
            <textarea type="text" id="dept_describe" class="form-control" >xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</textarea>
          </div>
        </div>
        <div class="form-group" style="margin:0 auto;display:block; width:100px">
        <button  class="btn btn-default"  onclick="addDept()">保存</button>
        </div>
      </form>
      </div>
</body>
<script>
//添加部门
function addDept(){
	//获取修改的信息
	//部门名称，负责人名称，部门编号，部门职责说明
	var dept_name=$("#dept_name").val();
	var dept_principal=$("#dept_principal_").val();
	var dept_number=$("#dept_number").val();
	var dept_describe=$("#dept_describe").val();
	//提交
	$.post("/ulms_project/dept/add",{dept_name:dept_name,dept_principal:dept_principal,dept_number:dept_number,dept_describe:dept_describe},function(data)
	{
		alert("添加部门成功！！！");
	});
	}
</script>
</html>